// 黑白滤镜
const baw = function (imgData) {
    for (var i = 0; i < imgData.data.length; i += 4) {
        var avg = (imgData.data[i] + imgData.data[i+1] + imgData.data[i+2]) / 3;
        imgData.data[i] = imgData.data[i+1] = imgData.data[i+2] = avg >= 100 ? 255 : 0;
    }

    return imgData;
}

export default baw;